import React, { Component } from 'react'
import "../../style/home/header.scss"
import { SearchOutline } from 'antd-mobile-icons'
import { useNavigate } from "react-router-dom"
interface Props {
  address: String
}
export default function Header(props: Props) {
  let navigate = useNavigate()

  let run = () => {
    navigate("/address")
  }
  return (
    <div className='header'>
      <div className="address" onClick={() => { run() }}>{props.address || '西安'}</div>
      <div className="input">
        <div className="logo">
          <img src="" alt="" />
          <span> | </span>
          <SearchOutline />
        </div>
        <input type="text" placeholder='立柜式空调' onClick={() => navigate("/search")} />
      </div>
      <div className="login" onClick={() => { navigate("/login") }}>
        登录
      </div>
    </div>
  )
}
